classes = [
    {"name": 'n1', "age": 24, "grade": "A"},
    {"name": 'n2', "age": 23, "grade": "C"},
    {"name": 'n3', "age": 21, "grade": "D"},
    {"name": 'n4', "age": 26, "grade": "A"},
    {"name": 'n5', "age": 29, "grade": "B"},
    {"name": 'n6', "age": 20, "grade": "B"},
    {"name": 'n7', "age": 22, "grade": "C"}
]


def age(d):
    d['age'] = d['age'] + 1
    return d

#使用filter筛选出grade为A的同学
L = filter(lambda x: True if x['grade'] == 'A' else False, classes)
print(list(L))

#使用map使age加1
m = map(age, classes)
print(list(m))